home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / UUPC11QS.ARJ / TESTIMP.C < prev    next >
C/C++ Source or Header  |  1991-08-23  |  2KB  |  58 lines

  1. /*--------------------------------------------------------------------*/
  2. /*       Program:    testimp     06/09/91                             */
  3. /*       Author:     Andrew H. Derbyshire                             */
  4. /*       Function:   Test UUPC/extended filename mapping              */
  5. /*                   functions                                        */
  6. /*                                                                    */
  7. /*       Copyright (C) 1991, Andrew H. Derbyshire                     */
  8. /*--------------------------------------------------------------------*/
  9.  
  10. #include <stdio.h>
  11. #include <stdarg.h>
  12. #include <assert.h>
  13.  
  14. #include "lib.h"
  15. #include "import.h"
  16. #include "export.h"
  17. #include "timestmp.h"
  18.  
  19. char *nodename = "kendra";
  20. char *panic_string = "Program aborting at line %d in file %s";
  21.  
  22. void main( int argc , char **argv )
  23. {
  24.    char canon[FILENAME_MAX];
  25.    char host[FILENAME_MAX];
  26.    size_t count;
  27.    banner( argv );            /* Out of habit, I guess               */
  28.    assert( argc > 2 );
  29.    for( count = 1; count < argc; count = count + 2)
  30.    {
  31.       importpath( canon, argv[ count + 1], argv[ count] );
  32.       printf("import %s\t%s\t yields %s\n",
  33.                argv[ count + 1], argv[ count] , canon);
  34.       fflush( stdout );
  35.       exportpath( host , canon,  argv[ count ] );
  36.       printf("\nexport %s\t%s\t yields %s\n",
  37.                argv[ count + 1], argv[ count] , host );
  38.    }
  39. } /* void */
  40.  
  41. /*--------------------------------------------------------------------*/
  42. /*           Replacement for UUPC/extended logging function           */
  43. /*--------------------------------------------------------------------*/
  44.  
  45. void printmsg(int level, char *fmt, ...)
  46. {
  47.    va_list arg_ptr;
  48.  
  49.    va_start(arg_ptr,fmt);
  50.    vfprintf(stdout, fmt, arg_ptr);
  51.    putchar('\n');
  52. }
  53.  
  54. void bugout( const size_t lineno, const char *fname)
  55. {
  56.     printf("bugout at %s line %s\n",fname, lineno );
  57.     exit(69);
  58. }